home *** CD-ROM | disk | FTP | other *** search
- Path: news.ust.hk!cckwwma
- From: cckwwma@uxmail.ust.hk (Wallace Ma)
- Newsgroups: comp.lang.c
- Subject: stdlib problem
- Date: 9 Feb 1996 10:09:24 GMT
- Organization: The Hong Kong University of Science and Technology
- Message-ID: <4ff6gk$ak2@news.ust.hk>
- NNTP-Posting-Host: ustsu3.ust.hk
- X-Newsreader: TIN [version 1.2 PL2]
-
- Hi there,
-
- When I run the following program using borland c++, I got the correct
- result. However, when I run it on SunOS 4.1.3 with C or C++ SparcCompiler
- v2.0 or 3.0, it couldn't get the data type ldiv_t in stdlib.h.
- Does anybody know is the data type ldiv_t defined and function ldiv
- can be found on the stdlib.h in SparcCompiler?
-
- thanks in advance....
- -Wallace
-
- ==================
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <limits.h>
-
-
- main()
- {
-
- long a, b;
- ldiv_t result;
-
- a=13;
- b=3;
- result = ldiv(a,b);
- printf("quotine=%1d\tremainder=%1d\n", result.quot, result.rem);
-
- }
- ==================
-